<?php 
/**
 * 阳关灿烂校区介绍
 * @author Haiqin
 *
 */
namespace Home\Controller;
class IntroduceController extends CommonController{
	public function index(){
		$xiaoqu = F('Xiaoqu/xiaoqu');
		if(!$xiaoqu){
			$xiaoqu = $this->xiaoqu->where(array('status'=>1))->field('id,title')->order('id desc')->select();
			F('Xiaoqu/xiaoqu',$xiaoqu);
		}
		$this->xiaoqu = $xiaoqu;
		$this->display();
	}
	
	public function detail(){
		$id = I('id');
		$xiaoqu = M('YgclDistrict')->where(array('id'=>$id))->find();

		//判断用户是否点赞
		$uid = $_SESSION['_loginUser_home']['uid'];
		$bool = D('YgclDianzai','Service')->get_isdianzai($uid,$id,'xiaoqu');
		$bool ? $t = 1:$t=0;
		$this->isdianzai = $t;
		$this->xiaoqu = $xiaoqu;
		$this->display();
	}
	
	public function kecheng(){
		$id = I('id');
		$this->district = D('YgclDistrict')->where(array('id'=>$id))->getField('title');
		$this->kecheng = D('YgclClass')->where(array('did'=>$id))->order('id desc')->select();
		$this->display();
	}
	
	public function kcdetail(){
		$id = I('id');
		$class = M('YgclClass')->where(array('id'=>$id))->find();
	
		//判断用户是否点赞
		$uid = $_SESSION['_loginUser_home']['uid'];
		$bool = D('YgclDianzai','Service')->get_isdianzai($uid,$id,'banji');
		
		$bool ? $t = 1:$t=0;
		$this->isdianzai = $t;
		$this->banji = $class;
		$this->display();
	}
}
?>